package com.example.jobback.controller.recruiter;

import com.example.jobback.req.common.page.PageReq;
import com.example.jobback.resp.recruiter.common.page.RCrossGetPageRecruitersResp;
import com.example.jobback.resp.recruiter.common.seeker.RCrossSeekerMessageResp;
import com.example.jobback.result.Result;
import com.example.jobback.service.recruiter.RecruiterCommonService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName: RecruiterCommonController
 * @Description:招聘者通用控制器
 * @Author: lhb
 * @Date: 2025/7/3
 */
@RestController
@RequestMapping("/recruiter/common")
@Tag(name = "招聘者-通用控制器",description = "招聘者通用服务对应的相关接口")
public class RecruiterCommonController {

    private final RecruiterCommonService recruiterCommonService;

    public RecruiterCommonController(RecruiterCommonService recruiterCommonService) {
        this.recruiterCommonService = recruiterCommonService;
    }

    @Operation(summary = "获取招聘者列表",description = "跨服务调用，被调用方",hidden = true)
    @ApiResponse(description = "无")
    @PostMapping("/getRecruiters")
    public Result<RCrossGetPageRecruitersResp> getRecruiters(@Validated
                                                                 @RequestBody
                                                                 PageReq pageReq){
        return recruiterCommonService.getRecruiters(pageReq);
    }


    @Operation(summary = "获取指定求职者基本信息",description = "跨服务，调用方")
    @GetMapping("/getSeekerBasicMessage")
    @ApiResponse(description = "返回求职者响应体")
    public Result<RCrossSeekerMessageResp> getSeekerBasicMessage(@Parameter(description = "指定用户的userId", required = true)
                                                                 @RequestParam Long userId){
        return recruiterCommonService.getSeekerBasicMessage(userId);
    }
}
